package org.example.kg_back.controller;

import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
import org.example.kg_back.PoJo.VO.LoginVO;
import org.example.kg_back.common.result.Result;
import org.example.kg_back.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Log4j2
@RestController
@RequestMapping("/api")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public Result<?> login(@RequestBody LoginVO loginVO){
        System.out.println("登录");
        return Result.success(loginService.login(loginVO));
    }

    @GetMapping("/hello")
    public Result<?> hello(){
        return Result.success("hello");
    }

}
